public class 换水问题 {
    
    public static void main(String[] args) {
        

    }

    public static int numWaterBottles(int numBottles, int numExchange) {
        
        int cnt = numBottles / (numExchange  - 1);
        return (numBottles % (numExchange - 1) == 0)
        ? numBottles + cnt - 1 : numBottles + cnt;
    }
}
